Optical pattern recognition technology has matured to the point where inexpensive optical character recognition (OCR) software can recognize individual characters of scanned-in text and convert such text to electronic format at rate of a few seconds per page. In some ways, recognizing text is simple compared to other pattern recognition tasks. Text—particularly Romanized text—is linear and has a relatively small set of possible shapes. OCR technology is not as easily applied to mathematical expressions, however. This is in part because mathematical expressions are often not linear. For example, numbers, variables, and operators of a single expression may be located throughout a two-dimensional area of a page. Furthermore, the meaning of a mathematical symbol may depend on its location within an expression. For example, a horizontal line may be a minus sign, a fraction bar, or a mean value. As another example, the number two could be a multiplicand, in an exponent, in a subscript, a limit of an integral, etc.